package com.rui.principles.demo03.after;
/**
 * @className    : Computer
 * @author       : [锐神NO.3]
 * @version      : [v1.0]
 * @createTime   : [2022/2/9 9:50]
 * @description  : [描述该类的功能]
 */
 
public class Computer {

    private HardDisk hardDisk;

    private Cpu cpu;

    private Memory memory;

    public HardDisk getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(HardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }

    public Cpu getCpu() {
        return cpu;
    }

    public void setCpu(Cpu cpu) {
        this.cpu = cpu;
    }

    public Memory getMemory() {
        return memory;
    }

    public void setMemory(Memory memory) {
        this.memory = memory;
    }

    /**
     * 运行计算机
     */
    public void run() {
        System.out.println("运行计算机");
        hardDisk.save("希捷硬盘存的数据");
        String data = hardDisk.get();
        System.out.println("从硬盘上获取的数据是：" + data);
        cpu.run();
        memory.save();
    }
}
